package com.example.baseapp.common;

import lombok.Data;

@Data
public class ApiResponse<T> {
    private int code;
    private T data;

    public ApiResponse() {}

    public ApiResponse(int code, T data) {
        this.code = code;
        this.data = data;
    }

    public static <T> ApiResponse<T> success(T data) {
        return new ApiResponse<>(200, data);
    }

    public static <T> ApiResponse<T> success() {
        return success(null);
    }

    public static <T> ApiResponse<T> error(String message) {
        return new ApiResponse<>(-1, null);
    }
} 